package com.threadDemo;

import java.util.concurrent.*;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

public class ConsumerThreadPoolExecutor extends ThreadPoolExecutor {

    public ConsumerThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler) {
        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, handler);
    }
    protected void beforeExecute(Thread t, Runnable r){
        super.beforeExecute(t,r);
        System.out.println("consumer服务每个线程开始前要做的事");
    }
    protected void afterExecute(Runnable r, Throwable t) {
        super.afterExecute(r,t);
        System.out.println("consumer服务每个线程结束要做的事");
    }
}
